<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

    </style>
</head>

<body>

</body>
<script>
    //创建promise对象
    const p = new Promise((rsolve, reject) => {
        setTimeout(() => {
            resolve('用户数据')
        }, 1000);
    });

    //调用then方法
    p.then(value => {
        console.log(value)
    }, reason => {

    })
</script>

</html>